﻿using ECNow.Core.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace ECNow.Data.DataInterfaces
{
    public interface IProductDac
    {
        /// <summary>
        /// 根据商品系统编号查询商品，如223
        /// </summary>
        /// <returns>商品实体</returns>
        Product Get(int id);

        /// <summary>
        /// 根据商品编码查询商品，如332-US-2566
        /// </summary>
        /// <param name="sku"></param>
        /// <returns>商品实体</returns>
        Product GetBySku(string sku);

        /// <summary>
        /// 查询商品sku
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        string GetSku(int id);

        /// <summary>
        /// 条件查询
        /// </summary>
        /// <returns></returns>
        List<Product> GetList();

        Page<Product> GetList(int pagesize, int pageindex);

        /// <summary>
        /// 更新商品
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        int Update(Product entity);

        /// <summary>
        /// 更新商品状态
        /// </summary>
        /// <param name="status"></param>
        /// <returns></returns>
        int UpdateStatus(int status);

        /// <summary>
        /// 创建商品
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        int Insert(Product entity);

        /// <summary>
        /// 逻辑删除商品
        /// </summary>
        /// <param name="id">商品系统编号</param>
        /// <returns></returns>
        int Delete(int id);
    }
}
